<?php
/**
 * User Social Network Connection
 * 
 * It will display the list of social network that the user is connected with
 * 
 * @author Xavier VILAIN
 * @package Hive\User
 * @license #license-hive-social#
 */

use Hive\Ressource\Source\Parser\Linkedin;
use Fox\Html\Button;
use Fox\Generator;
use Fox\Html\Header\Content;
$xview = Xview::instance();
$id = $xview->application()->getId();
// Customizing
$customizing = Hive\User\Customizing::instance();
$customizing->trackSummaryPage(array('mod' => 'users','act'=>'social','sac' => null));

$user = User::current();
$last_update = Msg(Hive::BUNDLE,Hive::LAST_UPDATE_ON,
					Fox\Utilities\DateTimes::toFullString($user->udate));
//$last_update = '<br><span class="i sub-title-mini"> '.$last_update.'</span>';
// Page Title
$header = new Content('page-header',Msg(Hive::BUNDLE,Hive::MENU_USER_BE_SOCIAL));
$html = Xview::instance()->messages(true);


$html .= '<p class="prettyprint">'.Msg(Hive::BUNDLE,Hive::SOCIAL_HELP).'</p>';

$linkedInUri = Linkedin::connectionUri();
if(User::current()->alreadyConnectedToLinked()) {
	$html .= '<a class="btn btn-inverse" style="width:350px" ><i class="icon-linkedin"></i><span style="margin-left:10px;color:white">'.Msg(Hive::BUNDLE,Hive::SOCIAL_LINKEDIN_ALREADY_CONNECTED).'</span></a>';
		
} else {
	$html .= '<a class="btn btn-warning" style="width:350px" href="'.$linkedInUri.'" ><i class="icon-linkedin"></i><span style="margin-left:10px">'.Msg(Hive::BUNDLE,Hive::SOCIAL_CONNECT_MY_LINKEDIN_ACCOUNT).'</span></a>';
	
}

// Viadeo
$html .= '<br><br>';
$html .= '<a class="btn btn-warning" style="width:350px" href="#"><i class="icon-viadeo"></i><span style="margin-left:10px">'.Msg(Hive::BUNDLE,Hive::SOCIAL_CONNECT_MY_VIADEO_ACCOUNT).'</span></a>';
// Facebook
$html .= '<br><br>';
$html .= '<a class="btn btn-warning" style="width:350px" href="#"><i class="icon-facebook"></i><span style="margin-left:10px">'.Msg(Hive::BUNDLE,Hive::SOCIAL_CONNECT_MY_FACEBOOK_ACCOUNT).'</span></a>';
// Twitter
$html .= '<br><br>';
$html .= '<a class="btn btn-warning" style="width:350px" href="#"><i class="icon-twitter"></i><span style="margin-left:10px">'.Msg(Hive::BUNDLE,Hive::SOCIAL_CONNECT_MY_TWITTER_ACCOUNT).'</span></a>';

?>
<div>
	<div class="page-header clearfix"><?php echo $header->render();?></div>
	<div class="contentArea">
		<div class="mbs" style="text-align: center;">
			<?php echo $html;?>
		</div>
	</div>
</div>